
public class ScrollingBar {
	
	private float x;
	private float y;
	private float posDot;
	private int height;
	private int bottomValue;
	private int topValue;
	private int currentValue;
	
    public ScrollingBar(float x, float y, int height, int bottomValue, int topValue, int currentValue){
		this.x = x;
		this.y = y;
		this.height = height;
		this.bottomValue = bottomValue;
		this.topValue = topValue;
		this.currentValue = currentValue;
		this.posDot = (y)-((currentValue/(topValue-bottomValue))*height);
	}
	
	public void drawBar(GraphicsWrapper gw){
		gw.setColor(0, 0, 0);
		gw.drawLine(x, y-(height/2), x, (y+height/2));
		//posDot = (y)-((currentValue/(topValue-bottomValue))*height);
		gw.fillCircle(x-6, posDot, 6);
	}
	
	public float getX() {
		return this.x;
	}
	
	public float getY() {
		return this.y;
	}
	
	public int getCurrentValue(){
		return currentValue;
	}
	
	public void setPosDot(float posDot) {
		this.posDot = posDot;
		this.currentValue = (int)(-((bottomValue-topValue)*((y+(height/2))-posDot))/height)+bottomValue;
	}
	
	public void setCurrentValue(int currentValue){
		this.currentValue = currentValue;
		if (currentValue >= topValue) this.currentValue = topValue;
		if (currentValue <= bottomValue) this.currentValue = bottomValue;
	}
	
	/*public ScrollingBar(float x, float y, int note){
		
		this.x = x;
		this.y = y;
		this.dot = (y-height/2)+((note*2)-(21*2));
		
	}
	
	public void drawBar(GraphicsWrapper gw){
		gw.setColor(0, 0, 0);
		gw.drawLine(x, y-(height/2), x, (y+height/2));
		gw.fillCircle(x-6, dot, 6);
	}
	
	public float getX() {
		return this.x;
	}
	
	public float getY() {
		return this.y;
	}
	
	public void setDot(int posDot){
		
		this.dot = (y-height/2)+((note*2)-(21*2));
	}*/
	

}
